package com.cimpm.permission.controller;

import com.cimpm.permission.entity.User;
import com.cimpm.permission.service.impl.UserServiceImpl;
import com.hby.common.annotation.aspect.AutoEntityProcess;
import com.hby.common.annotation.aspect.NoEntityAutoSingleProcess;
import com.hby.common.annotation.handler.AutoRequestBody;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("permission")
@CrossOrigin
public class UserController {

    @RequestMapping("/user")
    @AutoEntityProcess(BUSINESS_CLASS = User.class, LOG_MSG = "user", PERMISSION_TYPE = "5234")
    public Object userAuto(@AutoRequestBody Map<String, Object> param){
        return null;
    }

    @RequestMapping("/login")
    @NoEntityAutoSingleProcess(SERVICE_CLASS = UserServiceImpl.class, PARAM_FIELD = "name,pwd", LOG_MSG = "登录", PERMISSION_TYPE = "5")
    public Object login(@AutoRequestBody Map<String, Object> param) {
        return null;
    }

}
